package containers;

import java.util.ArrayList;
import java.util.Iterator;

import net.mindview.util.TextFile;

public class Ex15 {

	public static void main(String[] args) {
		
		ArrayList<String> al = new TextFile("src/containers/Ex15.java","\\W+");
		
		SlowMap<String, Integer> sm = new SlowMap<String, Integer>();
		
		Iterator<String> iter = al.iterator();
		
		while(iter.hasNext()){
			String s = iter.next();
			if(!sm.containsKey(s))
				sm.put(s, 1);
			else
				sm.put(s, sm.get(s) + 1);
		}
		
		System.out.println(sm);
	}
}
